/*——--------------函数：从文件读取菜单——————————————————*/
int load_dish(dish list[]) /*list为菜单总表*/
{
    int i = 0; /*总菜品数量*/
    FILE *fp;
    if ((fp = fopen("menu.txt", "r")) == NULL)
    {
        printf("Can't open the file!");
        exit(0);
    }
    while (!feof(fp))
    {
        fscanf(fp, "%s%s", list[i].name, list[i].type);
        if (!list[i].name[0])
        {
            fclose(fp);
            return i;
        }
        fscanf(fp, "%f%f%d", &list[i].cost, &list[i].price, &list[i].daily_supply);
        i++;
    }
    fclose(fp);
    return i; /*返回菜品总数量*/
}